package com.fyy.minio.jsl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import okhttp3.*;

import java.io.IOException;

public class GetVideoApiTest {

    public final static String URI = "http://123.13.218.244:1084/realvideo/address?guid=1002000100000000000000000020100";
    public final static String S1 = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsib2F1dGgyLXJlc291cmNlIl0sInVzZXJfbmFtZSI6InRlc3QyMjEwMTEiLCJzY29wZSI6WyJhbGwiXSwiY29tcGFueSI6InNhbnRhY2hpIiwiZXhwIjoxNjY1NjU2NTQwLCJhdXRob3JpdGllcyI6WyJST0xFX0FETUlOIl0sImp0aSI6IjNiMmE1MTA4LTMxYWMtNGUzYS04NGQ2LTUzM2QxNDM4NDk1NCIsImNsaWVudF9pZCI6IndlYmN1Q2xpZW50In0.bqYP_rFJ6A_qyhEI1IMRyeMqFm7ACQ0Q2sl17SuYISo";

    public static void main(String[] args) throws IOException {

        OkHttpClient client = new OkHttpClient().newBuilder().build();
        MediaType mediaType = MediaType.parse("text/plain");
        RequestBody body = RequestBody.create(mediaType,"");
        Request request = new Request.Builder()
                .url(URI)
                .method("POST",body)
                .addHeader("Authorization","bearer " + S1)
                .build();
        Response response = client.newCall(request).execute();
        System.out.println("请求结果：" + response.code());
        if(response.isSuccessful()){
            String string = response.body().string();
            System.out.println(string);
        }

    }

}
